package com.dmzc.stage1.chapter5;

public class TestNotify {

    public static void main(String[] args) {
        Test1 t=new Test1();
        t.start();
        t.testNotify();
    }
}
class Test1 extends Thread{
    private final Object MUTEX=new Object();
    private synchronized void testWait(){
        try {
            this.wait();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    public synchronized void testNotify(){
        this.notify();
    }
    @Override
    public void run() {
        testWait();
        System.out.println("被唤醒啦");
    }
}

